package com.vtech.mybatis.baseservice.base;

import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.List;

/**
 * TODO
 * mbg扩展插件的Mapper基类接口
 *
 * @author houzhiwei
 * @Date 2015/12/13 14:51:51
 */
public interface BaseMapper<T, I extends Serializable>
{
    int deleteByPrimaryKey(I id);

    int insert(T record);

    T selectByPrimaryKey(I id);

    List<T> selectAll();

    int updateByPrimaryKey(T record);

    int deleteByColumn(@Param("columnName") String columnName, @Param("columnValue") Object columnValue);

    T selectByColumn(@Param("columnName") String columnName, @Param("columnValue") Object columnValue);

    int insertBatch(List<T> records);

    int deleteBatch(List<I> keys);

    List<T> selectByPrimaryKeys(List<I> keys);
}
